//题库
import Http from "../../utils/HttpUtil";
import URL from "../URL";
export default{
    //查看题库目录列表
    //类型 0驾驶员题库 1口试指南
    async  SelectQuestionChapterList(type){
        let url=URL.GetURL(URL.QuestionSelectQuestionChapterList);
        return await(Http.Get(url+"?type="+type))
        .then(response=>{
            return(response);
        },reject=>{
            return Promise.reject(reject);
        });
    },

    //查看题库目录题号列表
    async  SelectQuestionChapterNumberList(questionId){
        let url=URL.GetURL(URL.QuestionSelectQuestionChapterNumberList);
        return await(Http.Get(url+"?questionId="+questionId))
        .then(response=>{
            return(response);
        },reject=>{
            return Promise.reject(reject);
        });
    },

    //查看题详情
    //type 类型 0驾驶员题库 1口试指南
    //questionId 目录Id
    //questionNumber  题号第一题就传1以此类推
    async  SelectQuestionChapterNumberDetails(type,questionId,questionNumber){
        let url=URL.GetURL(URL.QuestionSelectQuestionChapterNumberDetails);
        return await(Http.Get(url+`?type=${type}&questionId=${questionId}&questionNumber=${questionNumber}`))
        .then(response=>{
            return(response);
        },reject=>{
            return Promise.reject(reject);
        });
    },

    //查看总题数
    async  SelectQuestioncount(questionId){
        let url=URL.GetURL(URL.QuestionSelectQuestioncount);
        return await(Http.Get(url+"?questionId="+questionId))
        .then(response=>{
            return(response);
        },reject=>{
            return Promise.reject(reject);
        });
    },
}